//
//  SYMobileHeaderView.m
//  SanYiTeaching
//
//  Created by 郑浩然 on 2019/4/15.
//  Copyright © 2019年 SanYi. All rights reserved.
//

#import "SYMobileHeaderView.h"

@interface SYMobileHeaderView ()

@property (strong, nonatomic) UIImageView *headerImage;


@property (strong, nonatomic) UIImageView *xlImageView;//下啦
@property (strong, nonatomic) UIButton *selectBtn;
@end

@implementation SYMobileHeaderView

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        [self initSubView];
    }
    return self;
}

- (void)initSubView {
    //文件夹
    [self addSubview:self.headerImage];
    [self.headerImage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.mas_centerY);
        make.left.equalTo(self.mas_left).offset(50);
    }];
    [self addSubview:self.headerLab];
    [self.headerLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.mas_centerY);
        make.left.equalTo(self.headerImage.mas_right).offset(10);
    }];
    [self addSubview:self.xlImageView];
    [self.xlImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self.mas_right).offset(-15);
        make.centerY.equalTo(self.mas_centerY);
    }];
    
    [self addSubview:self.selectBtn];
    [self.selectBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.right.bottom.equalTo(self);
    }];
}


#pragma mark - set
- (void)selectBtnClick {
    
}

#pragma mark -
- (UIImageView *)headerImage {
    if (!_headerImage) {
        _headerImage = [[UIImageView alloc] init];
        _headerImage.image = [UIImage imageNamed:@"zy_tab_xjwjj"];
    }
    return _headerImage;
}
- (UILabel *)headerLab {
    if (!_headerLab) {
        _headerLab = [UILabel titleColour:TITLECOLOR
                               titleFount:14
                                 pingfang:@"PingFang-SC-Medium"
                                alignment:NSTextAlignmentCenter
                                titleLine:1];
        _headerLab.text = @"我的作品";
    }
    return _headerLab;
}
- (UIImageView *)xlImageView {
    if (!_xlImageView) {
        _xlImageView = [[UIImageView alloc] init];
        _xlImageView.image = [UIImage imageNamed:@"arrow_down"];
    }
    return _xlImageView;
}
- (UIButton *)selectBtn {
    if (!_selectBtn) {
        _selectBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        [_selectBtn addTarget:self action:@selector(selectBtnClick) forControlEvents:UIControlEventTouchUpInside];
    }
    return _selectBtn;
}
@end


























